#!/bin/sh
DEST_DIR=$2
if ["$DEST_DIR" = ""]; then
	DEST_DIR=":\Temp"
fi

rm -rf ./deploy-dir
mkdir ./deploy-dir

cp $MINGW32CE_PATH/bin/libgcc_s_sjlj-1.dll ./deploy-dir
cp ../glibce/glib/.libs/*.dll ./deploy-dir
cp ../glibce/gthread/.libs/*.dll ./deploy-dir
cp ../glibce/gobject/.libs/*.dll ./deploy-dir
cp $1 ./deploy-dir

../tools/upx-3.04-i386_linux/upx ./deploy-dir/*

synce-pcp ./deploy-dir/libgcc_s_sjlj-1.dll "$DEST_DIR"
synce-pcp ./deploy-dir/libgobject-2.0-0.dll "$DEST_DIR"
synce-pcp ./deploy-dir/libglibce-2.0-0.dll  "$DEST_DIR"
synce-pcp ./deploy-dir/libgthread-2.0-2.dll  "$DEST_DIR"
synce-pcp ./deploy-dir/`basename $1` "$DEST_DIR"
